-
Notifications
You must be signed in to change notification settings - Fork 1
feat(rust/rbac-registration): RBAC stolen StakeAddress handling.
#631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
stanislav-tkach
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the change is ok in general, but I don't quite get the idea with the updated URI set. As far as I can see, we are still not storing the full history and only the final state in Cip0134UriSet. In that case why do we want to store "taken" addresses separately? Why not store the resulting final state? For example currently we would have something like this:
x_uris: [A, B, C],
c_uris: [D, E],
taken_uris: [B, C, D],But it can be represented as
x_uris: [A],
c_uris: [E],Am I missing something?
rust/rbac-registration/src/cardano/cip509/utils/cip134_uri_set.rs
Outdated
Show resolved
Hide resolved
rust/rbac-registration/src/cardano/cip509/utils/cip134_uri_set.rs
Outdated
Show resolved
Hide resolved
rust/rbac-registration/src/cardano/cip509/utils/cip134_uri_set.rs
Outdated
Show resolved
Hide resolved
rust/rbac-registration/src/cardano/cip509/utils/cip134_uri_set.rs
Outdated
Show resolved
Hide resolved
|
Also I would like to see how we handle the caching on the |
📚 Docs PreviewThe docs for this PR can be previewed at the following URL: https://docs.dev.projectcatalyst.io/libs/feat/rbac-stake-address-processing |
|
✅ Test Report | |
| cip509.report().functional_validation( | ||
| &format!( | ||
| "Trying to apply the first registration to the associated {} again", | ||
| cat_id.as_short_id() | ||
| ), | ||
| "It isn't allowed to submit first registration twice", | ||
| ); | ||
| return None; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed that before, but I missed one case and this actually allowed. We can only get a Catalyst ID of a registration if the role 0 certificate is present. That should always be true for the root registration, but it is also allowed for any following registration too.
Description
Processing scenario when another registration chain could "stole"
cip0134uriaddress, so it become not accessible for the current one after applying such registration.Related Issue(s)
Part of #578
Description of Changes
taken_uris: HashSet<Cip0134Uri>,andupdate_taken_urisforCip0134UriSetstruct. Also modify the originalupdatemethod, so it removes thetaken_uris, which enables the functionality of returning back "stolen" addresses.signing_pk_for_rolemethod for theCip509type.new,updatemethods for theRegistrationChaintype.Please confirm the following checks